Stylist
Stylist is a CSS-in-Rust styling solution for WebAssembly Applications.
This is a fork of css-in-rust.
Install
Add the following to your Cargo.toml
:
= "0.13"
Usage
For detailed usage, please see documentation.
Yew Integration
To style your component, you can use styled_component
attribute with css!
macro.
use *;
use styled_component;
Standalone
To create a stylesheet, you can use style!
:
use style;
let style = style!.expect;
// stylist-uSu9NZZu
println!;
Runtime Style
If you want to parse a string into a style at runtime, you can use Style::new
:
use Style;
let style_str = r#"
background-color: red;
.nested {
background-color: blue;
width: 100px
}
"#;
let style = new.expect;
// stylist-uSu9NZZu
println!;
Theming
There's theming example using Yew Context API.